package com.wm.youfangtong.ui.fragment

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.fragment.NavHostFragment
import com.wm.youfangtong.R
import com.wm.youfangtong.base.BaseFragment
import com.wm.youfangtong.databinding.FragmentPhoneBinding

/**
 * author: wu-meng
 * date  : 2023/12/13
 * desc  : 手机号页面
 */
class PhoneFragment : BaseFragment<FragmentPhoneBinding>(), View.OnClickListener {

    override fun getViewBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentPhoneBinding {
        return FragmentPhoneBinding.inflate(inflater,container,false)
    }

    override fun initView() {
    }

    override fun initData() {
    }

    override fun initListener() {
        binding?.ivBack?.setOnClickListener(this)
        binding?.tvNext?.setOnClickListener(this)
    }

    override fun observeData() {
    }

    override fun onClick(v: View?) {
        val id = v?.id
        when (id) {
            R.id.iv_back -> { // 退出
                NavHostFragment.findNavController(this).popBackStack()
            }

            R.id.tv_next -> { // 下一步
                NavHostFragment.findNavController(this).navigate(R.id.verificationCodeFragment)
            }
        }
    }


}